<script>
import ModalBase from "../modelView/modal";

import $ from "@/common";
export default {
  extends: ModalBase,
  data() {
    return {
      pathModel: "service/{app}/bill/model/{bill_code}",
      actionProto: {
        name: "数据钻取"
      }
    };
  },
  computed: {
    modelPath() {
      return $.composePath(
        this.actionModel.param.path_model || this.pathModel,
        { ...this.actionData, bill_code: this.actionModel.param.bill_code }
      );
    }
  },
  methods: {
    afterLoad() {
      var data = {};
      var mapping = this.modelParam("filter_mapping");
      if (mapping) {
        for (let i in mapping) {
          if (this.actionData[i] !== null && this.actionData[i] !== undefined) {
            data[mapping[i]] = this.actionData[i];
          }
        }
      }
      if (this.modelParam("list_filter")) {
        for (let i in this.$owner.filterObj) {
          if (data[i] === null || data[i] === undefined) {
            data[i] = this.$owner.filterObj[i];
          }
        }
      }
      this.$set(this, "fixedFilter", data);
    }
  }
};
</script>
<style lang="less">
.modal-action-drill {
  .node-panel {
    height: auto;
  }
}
</style>

